#include "tim.h"
#include "main.h"
#include "pid.h"
#include "configs.h"

typedef struct
{
    float speed;
	int16_t endc_past[5];
    int16_t endc;//500 per round
    pid_type_def pos_pid;
}motor_data_t;

extern motor_data_t motor_data[2];

void Motor_init(void);
void encoder_read(void);
void pwm_control(TIM_HandleTypeDef HTIMX,uint16_t ang,int16_t ch);
void motor_speed_set(int id,int dir,int speed);
void motor_pos_set(void);
void ang_to_enc(void);

